﻿using System.Text;
using Sanelib.Common.SystemSettings;

namespace Sanelib.CodeMaker.Generators
{
    public class TestGenerator
    {
        public static void Generate(DatabaseTableSchema tbSchema)
        {
            var sb = new StringBuilder();

            sb.AppendLine("using System;");
            sb.AppendLine("using Sanelib.Dto;");
            sb.AppendLine("using NUnit.Framework;");
            sb.AppendLine("//defined your libraries here...");
            sb.AppendLine("");
            sb.AppendLine("namespace ");
            sb.AppendLine("{");
            sb.AppendLine("\tpublic class Add" + tbSchema.TableName + "Tester : IntegrationTestBase");
            sb.AppendLine("\t{");
            sb.AppendLine("\t\t[Test]");
            sb.AppendLine("\t\tpublic void ShouldAdd" + tbSchema.TableName + "()");
            sb.AppendLine("\t\t{");
            sb.AppendLine("\t\t}");
            sb.AppendLine("\t}");
            sb.AppendLine("}");

            System.IO.File.WriteAllText(Globals.CreateOrGetCustomPath("..\\IntegrationTest\\ProcessorTester\\") + tbSchema.TableName + "_Generated.cs", sb.ToString());
        }
    }
}
